package writeor.aidraw.service.impl;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import writeor.aidraw.dao.GenerateDao;
import writeor.aidraw.dao.HomeDao;
import writeor.aidraw.model.AiImages;
import writeor.aidraw.service.HomeService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Service
public class HomeServiceImpl implements HomeService {
    @Autowired
    public HomeDao homeDao;

    @Override
    public List<AiImages> getHotImages() {
        return homeDao.getHotImages();
    }
    ////主页分页信息
    @Override
    public PageInfo<AiImages> getHotImagesForPage(Integer page, Integer count) {
        PageHelper.startPage(page,count);
        List<AiImages> list= homeDao.getHotImages();
        PageInfo<AiImages> pageInfo=new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public AiImages GetImageByPath(String img_path) {
        return homeDao.GetImageByPath(img_path);
    }

//    @Override
//    public List<Category> getCateList() {
//        return dao.getList();
//    }
//
//    @Override
//    public List<Goods> getGoodsByCateID(String cateId) {
//        return dao.getListByCateID(cateId);
//    }
}
